<!--
 * @Author: Liz.Zheng
 * @Date: 2021-11-29 15:20:32
 * @LastEditTime: 2021-11-29 19:43:25
 * @LastEditors: Liz.Zheng
 * @Description: 关键词模块
 * @Motto: Write the code. Change the world.
-->
<template>
  <a-card
    size="small"
    v-for="(item, contentIndex) of content"
    :key="item.key"
    :title="item.title"
    :class="contentIndex == 0 ? '' : 'mt-20'"
  >
    <template v-if="item.list && item.list.length">
      <template v-for="(listItem, listIndex) of item.list" :key="listIndex">
        <CustomTableFields
          :item="listItem"
          :tableFields="tableFields"
          @getColumns="(arr) => changeCheck(listItem, arr)"
        />
      </template>
    </template>
  </a-card>
</template>

<script>
import {computed, defineComponent} from "vue";
import utils from "../../../../common/utils/utils";
import store from "@/store";
import CustomTableFields from "@/views/contract/RetreatAgreement/modules/CustomTableFields.vue";

export default defineComponent({
  name: "addTemplateCardItem",
  components: {CustomTableFields},
  props: {
    content: {
      type: Object,
      default: () => {
        return {};
      },
    },
    tableFields: {
      type: Object,
      default: () => {
        return {};
      },
    },
  },
  setup(props, { emit }) {
    const changeCheck = (listItem, arr) => {
      if (listItem?.table?.name) {
        emit("changeTableField", listItem?.table?.name, arr);
      }
    };

    return {
      changeCheck,
    };
  },
});
</script>

<style></style>
